import { RegistRules } from './Event/GetRules.js'


export default {
    install: async function (app) {
        // app.AddRouter([]);



        // 注入组件
        // app.RegistPluginCompontent('VisualEditor-Core.Layout', defineAsyncComponent(() => import('./View/Layout.vue')));

        app.RegistPluginCompontent('VisualEditor-Core.DocumentEditor', () => import('./Document/EditIndex.vue'));

        app.RegistPluginCompontent('VisualEditor-Core.FormItems', () => import('./Component/FormConfig/Items.vue'));

        app.RegistPluginCompontent('VisualEditor-Core.AntdIcon', () => import('./Component/FormConfig/AntdIcon.vue'))


        // DataScreen 大屏
        // FieldBus 组态

        // Form 表单
        // Report 报表
        // Word 报告

        // Layer 层级
        // Layout 布局
        // Base 基本


        // 注册 向核心 注入组件方法
        app.RegistPluginEvent('VisualEditor-Core.RegistCell', (key, Cell) => {
            RegistRules(key, Cell)
        });

        app.on('VisualEditor-Core.Runing', () => {
            RegistRules('Layer-Page', import('./Cell/Layer-Page/index.js'))
            RegistRules('Layout-Container', import('./Cell/Layout-Container/index.js'))
        })
    }
}

